xtask\tasks\guest_test/
mod.rs

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4use crate::Xtask;
5use clap::Parser;
6
7mod download_image;
8mod uefi;
9
10/// Xtask to build guest-test images (for E2E VM testing)
11#[derive(Parser)]
12#[clap(
13    about = "Utilities to prepare guest test images",
14    disable_help_subcommand = true,
15    after_help = r#"NOTES:
16
17    For documentation on each subcommand, see the corresponding subcommands's help page.
18"#
19)]
20pub struct GuestTest {
21    #[clap(subcommand)]
22    command: Subcommand,
23}
24
25#[derive(clap::Subcommand)]
26enum Subcommand {
27    Uefi(uefi::Uefi),
28    DownloadImage(download_image::DownloadImageTask),
29}
30
31impl Xtask for GuestTest {
32    fn run(self, ctx: crate::XtaskCtx) -> anyhow::Result<()> {
33        match self.command {
34            Subcommand::Uefi(task) => task.run(ctx),
35            Subcommand::DownloadImage(task) => task.run(ctx),
36        }
37    }
38}